//
//  UIImage+Extensions.h
//  TMarket
//
//  Created by ZhangAo on 12/20/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

#define stretchImgFromMiddle(img)	[(img) stretchableImageWithLeftCapWidth:(img).size.width / 2 topCapHeight:(img).size.height / 2]

@interface UIImage (Extensions)

+ (UIImage *)imageFromColor:(UIColor *)color;

+ (UIImage *)imageFromColor:(UIColor *)color rect:(CGRect)rect;

+ (UIImage *)imageFromColor:(UIColor *)color cornerRadius:(CGFloat)radius;

- (UIImage *)synthesizeImage:(UIImage *)image;

- (UIImage *)imageByScalingAndCroppingForSize:(CGSize)cropSize;

- (UIImage *)adjustImageToCorrectOrientation;

- (UIImage *)imageForMask:(UIImage *)maskImage;

- (UIImage *)imageWithColor:(UIColor *)color;

@end

@interface NSData (AdjustImageToCorrectOrientation)

- (NSData *)adjustImageToCorrectOrientation;

@end
